package com.magic.gre.mvp.model;

import com.magic.gre.Api;
import com.magic.gre.mvp.contract.ModifyPhoneContract;
import com.noname.lib_base_java.mvp.BaseModelImpl;
import com.noname.lib_base_java.net.RtManager;

import io.reactivex.Observable;
import io.reactivex.Observer;
import okhttp3.ResponseBody;

/**
 * Author: Lmoumou
 * Date: 2019-01-11 11:30
 * 文件名: ModifyPhoneModelImpl
 * 描述:
 */
public class ModifyPhoneModelImpl extends BaseModelImpl implements ModifyPhoneContract.Model {
    @Override
    public void mSmsCode(Observer<ResponseBody> observer, String phone, int type) {
        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).smsCode(phone,type);
        doHttp(observer, observable);
    }

    @Override
    public void mChangePhone(Observer<ResponseBody> observer, String phone, String securityCode) {
        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).changePhone(phone, securityCode);
        doHttp(observer,observable);
    }
}
